﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="DeleteExpiredNews.aspx.cs" Inherits="Admin.Admin.DeleteExpiredNews"
    Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script type="text/javascript">  
   
    function confirmAction() {
    if(confirm('Bạn có chắc chắn muốn xóa???')) {
        return true;
    }
    else {
      
        return false;
    }
        }

    </script>

    <asp:Panel ID="Panel1" runat="server">
        <div class="dashboard">
            <h2 class="ico_mug">
                Tin hết hạn
            </h2>
            <div>
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="100%"
                    CellPadding="4" DataKeyNames="AreaID" DataSourceID="ObjectDataSource1" ForeColor="#333333"
                    GridLines="None" AllowPaging="True" PageSize="5" OnRowCommand="GridView1_RowCommand">
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <RowStyle BackColor="#EFF3FB" />
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Xoa" ImageUrl="~/Admin/img/cancel.jpg" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Mã tin">
                            <ItemTemplate>
                                <asp:Label ID="lblMatin" runat="server" Text='<%# Eval("NewsID") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Title" HeaderText="Tiêu đề" SortExpression="Title" />
                        <asp:BoundField DataField="CreatedDate" HeaderText="Ngày Tạo" SortExpression="CreatedDate" />
                        <asp:BoundField DataField="ExpireDate" HeaderText="Hết Hạn" SortExpression="ExpireDate" />
                        <asp:BoundField DataField="AreaDetailName" HeaderText="Vị Trí" SortExpression="AreaDetailName" />
                        <asp:CheckBoxField DataField="IsActive" HeaderText="IsActive" SortExpression="IsActive" />
                    </Columns>
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" EnablePaging="True" SelectCountMethod="GetToTalExpired"
                    SelectMethod="GetExpiredNewsPaged" TypeName="HousingInfo.Library.NewsBOList">
                </asp:ObjectDataSource>
                <br />
                <asp:Label ID="message" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="Red"></asp:Label>
                <br />
                <br />
                <asp:Button ID="btnDeleteAll" runat="server" OnClientClick="javascript:return confirmAction();"
                    Text="Xóa tất cả" OnClick="btnDeleteAll_Click" />
            </div>
        </div>
    </asp:Panel>
</asp:Content>
